import request from "@/utils/request";
export const getBrandListAPi = (params: any) => {
  return request({
    url: "/carfilm.vehicle/getGroupedVehicles",
    method: "get",
    params,
  });
};

export const deleteApi = (id: number) => {
  return request({
    url: "/carfilm.vehicle/delete",
    method: "delete",
    params: { id },
  });
};

export const addApi = (data: any) => {
  return request({
    url: "/carfilm.vehicle/add",
    method: "post",
    data,
  });
};

export const editApi = (data: any) => {
  return request({
    url: "/carfilm.vehicle/update",
    method: "put",
    data,
  });
};

/*价格管理 */
export const getPriceListApi = (params: any) => {
  return request({
    url: "/carfilm.pricing/index",
    method: "get",
    params,
  });
};

export const getVehicleOptionsApi = (params: any) => {
  return request({
    url: "/carfilm.pricing/getVehicleOptions",
    method: "get",
    params,
  });
};

export const getProductOptionsApi = (params?: any) => {
  return request({
    url: "/carfilm.pricing/getProductOptions",
    method: "get",
    params,
  });
};

export const getCoveredVehiclesApi = (params?: any) => {
  return request({
    url: "/carfilm.pricing/getCoveredVehicles",
    method: "get",
    params,
  });
};

export const addPriceApi = (data: any) => {
  return request({
    url: "/carfilm.pricing/add",
    method: "post",
    data,
  });
};

export const editPriceApi = (data: any) => {
  return request({
    url: "/carfilm.pricing/update",
    method: "put",
    data,
  });
};

export const deletePriceApi = (id: number) => {
  return request({
    url: "/carfilm.pricing/delete",
    method: "delete",
    params: { id },
  });
};

//批量更新价格
export const batchUpdatePriceApi = (data: any) => {
  return request({
    url: "/carfilm.pricing/batchUpdate",
    method: "put",
    data,
  });
};

//产品列表
export const getProductListApi = (params: any) => {
  return request({
    url: "/carfilm.product/index",
    method: "get",
    params,
  });
};
export const addProductApi = (data: any) => {
  return request({
    url: "/carfilm.product/add",
    method: "post",
    data,
  });
};
export const editProductApi = (data: any) => {
  return request({
    url: "/carfilm.product/update",
    method: "put",
    data,
  });
};
export const deleteProductApi = (id: number) => {
  return request({
    url: "/carfilm.product/delete",
    method: "delete",
    params: { id },
  });
};

//导入
export const importProductApi = (data: any) => {
  return request({
    url: "/carfilm.product/import",
    method: "post",
    data,
  });
};
